home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / pv3dv1.zip / PV3DV100.EXE / PV3D_EFF.BAS < prev    next >
BASIC Source File  |  1993-03-12  |  3KB  |  84 lines

  1. CLS
  2. '========================================================================
  3. PRINT "PV3D effect animation file generator V1.00"
  4. PRINT "By L Lecointe Copyright 1993"
  5. PRINT
  6. PRINT "Sample program to generate a *.EFF file for the PV3D Modeler software"
  7. PRINT
  8. '========================================================================
  9.  
  10. 'flag parameter
  11. sx% = 1               'PV3D X scale (not POV scale)      float
  12. sy% = 2               'PV3D Y scale (not POV scale)      float
  13. sz% = 4               'PV3D Z scale (not POV scale)      float
  14. tx% = 8               'X axis translation                float
  15. ty% = 16              'Y axis translation                float
  16. tz% = 32              'Z axis translation                float
  17. rx% = 64              'X rotation in degre 0->360        int
  18. ry% = 128             'Y rotation in degre 0->360        int
  19. rz% = 256             'Z rotation in degre 0->360        int
  20. cr% = 512             'Red   colors 0.0->1.0             float
  21. cg% = 1024            'Green colors 0.0->1.0             float
  22. cb% = 2048            'Blue  colors 0.0->1.0             float
  23. ca% = 4096            'Alpha colors 0.0->1.0             float
  24. 'Constant
  25. control$ = "PV3D_EFFECT"
  26. nbframe% = 0
  27. noused% = 0
  28. noused2 = 0
  29. flag% = &HFFFF
  30. degre.to.rad = 3.14116 / 180
  31.  
  32.  
  33. CLS
  34. INPUT "Input the file name.EFF  : ", name$
  35. INPUT "Imput the description file :", descrip$
  36. INPUT "Input the number of step : ", nbframe%
  37.  
  38. INPUT "Input the start value    : ", startvalue
  39. INPUT "Input the end value      : ", endvalue
  40.  
  41. 'flag construction
  42. 'in this case all parameter are available  with this formula in PV3D
  43. 'flag% = sx% + sy% + sz% + tx% + ty% + tz% + rx% + ry% + rz% + cr% + cg% + cb% + ca%
  44. 'if only translation  and alpha
  45. 'flag% = tx% + ty% + tz%  + ca%
  46. 'select only translation in TX TY
  47.  flag% = tx% + ty%
  48.  
  49.  
  50. OPEN name$ FOR OUTPUT AS #1
  51. PRINT #1, control$
  52. PRINT #1, descrip$
  53. PRINT #1, nbframe%, 13, flag%, noused2
  54. stepvalue = (endvalue - startvalue) / nbframe%
  55. PRINT stepvalue
  56. FOR i = 1 TO nbframe%
  57. sx = 1: sy = 1: sz = 1
  58. tx = 0: ty = 0: tz = 0
  59. rx = 0: ry = 0: rz = 0
  60. cr = 1: cg = 1: cb = 1: ca = 1
  61.  
  62. 'put the formula here
  63. 'sample formula
  64. '
  65. ' y=sin (startvalue)
  66. ' y=cos (startvalue)
  67. ' y=startvalue^2
  68. ' y=a*(startvalue)+b
  69.    'if n=1 you have a heart figure
  70.    n = 1
  71.    R = 1 + SIN(n * startvalue * degre.to.rad)         ' Equation polaire de la courbe.
  72.    tx = R * COS(startvalue * degre.to.rad)            ' Convertir les coordonnées polaires
  73.    ty = R * SIN(startvalue * degre.to.rad)            ' en coordonnées cartésiennes.
  74.  
  75. PRINT tx; ty
  76. PRINT #1, sx; sy; sz; tx; ty; tz; rx; ry; rz; cr; cg; cb; ca
  77. startvalue = startvalue + stepvalue
  78. NEXT i
  79. CLOSE #1
  80.  
  81.  
  82.  
  83.  
  84.